package ru.onlinestore.mobile.ui.components

import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import ru.onlinestore.mobile.ui.theme.black
import ru.onlinestore.mobile.ui.theme.green
import ru.onlinestore.mobile.ui.theme.white
import ru.onlinestore.mobile.ui.theme.white2

@Composable
@Preview(
    showBackground = true, device = "id:Xiaomi POCO M5s"
)
private fun ToolBarPreview() = ToolBar(title = "ToolBar")

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ToolBar(title: String) {
    CenterAlignedTopAppBar(
        title = {
            Text(
                text = title,
                style = TextStyle(
                    fontWeight = FontWeight.Bold,
                    fontSize = 24.sp
                )
            )
        },
        colors = TopAppBarColors(
            containerColor = white2,
            titleContentColor = black,
            scrolledContainerColor = white,
            actionIconContentColor = white,
            navigationIconContentColor = white
        )
    )
}